<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<html>
<head>
    <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
    <script type="text/javascript">
        $(function () {
            //按钮单击时执行
            $("#btn").click(function () {
                //Ajax调用处理
                $.ajax({
                    type: "GET",
                    contentType: "application/json",
                    url: "http://localhost:8090/test/log",
                    data: {},
                    success: function (data) {
                        alert(data.code);
                    }
                });

            });
        });
    </script>
</head>
<body>
<form th:action="@{/users/{action}(action=${action})}" method="post" class="form-horizontal">
    <input type="hidden" name="id" th:value="${user.id}"/>
    <div class="form-group">
        <label for="user_name" class="col-sm-2 control-label">名称</label>
        <div class="col-xs-4">
            <input type="text" class="form-control" id="user_name" name="name" th:value="${user.name}"/>
        </div>
    </div>
    <div class="form-group">
        <label for="user_age" class="col-sm-2 control-label">年龄:</label>
        <div class="col-xs-4">
            <input type="text" class="form-control" id="user_age" name="age" th:value="${user.age}"/>
        </div>
    </div>
    <div class="form-group">
        <label for="user_birthday" class="col-sm-2 control-label">出生日期:</label>
        <div class="col-xs-4">
            <input type="date" class="form-control" id="user_birthday" name="birthday" th:value="${user.birthday}"/>
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <input class="btn btn-primary" type="submit" value="提交"/>  
            <input class="btn" type="button" value="返回" onclick="history.back()"/>
        </div>
    </div>
</form>
</body>
</html>